package datastructure.str;

/**
 * @Author yao.xiao
 * @Date 2025/8/20 14:55
 * @Description 反转字符串
 */
public class LC344 {
    public void reverseString(char[] s) {
        if (s.length <= 1){
            return;
        }
        int left = 0,right = s.length-1;
        while (left < right) {
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }
    }
}